import { Type } from 'class-transformer'
import { IsDate, IsNotEmpty, IsNumber, IsOptional } from 'class-validator'
import i18n from '@/i18n'
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger'

export class MetaHistoryChartUpdateByIdDto {
  @ApiProperty({ description: 'ID' })
  @IsNotEmpty()
  @IsNumber()
  id: number

  @ApiPropertyOptional({ description: i18n.t('dto.meta-history-chart-update-by-id.002592-1'), type: Number })
  @IsDate()
  @IsOptional()
  @Type(() => Date)
  limitBeginTime?: Date

  @ApiPropertyOptional({ description: i18n.t('dto.meta-history-chart-update-by-id.002592-2'), type: Number })
  @IsDate()
  @IsOptional()
  @Type(() => Date)
  limitEndTime?: Date

  @ApiPropertyOptional({ description: i18n.t('dto.meta-history-chart-update-by-id.002592-3') })
  @IsOptional()
  queryGranularity?: string

  @ApiPropertyOptional({ description: i18n.t('dto.meta-history-chart-update-by-id.002592-4') })
  @IsOptional()
  dataFillingStrategy?: string
}
